package org.example;

/**
 * @author 90616
 * @description ${DESCRIPTION}
 * @create 2025/6/29 22:33
 */
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
}

//双重检验锁实现单列对象
final class Singleton{
    public Singleton(){

    }
    public static volatile Singleton INSTANCE = null;

    public static Singleton getInstance(){
        if(INSTANCE == null){
            synchronized (Singleton.class){
                if(INSTANCE == null){
                    INSTANCE = new Singleton();
                }
            }
        }
        return INSTANCE;
    }
}